﻿@model HousePicDTO[]

<link href="~/lib/lightbox2/2.8.1/css/lightbox.css" rel="stylesheet" type="text/css">

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 图片管理 <span class="c-gray en">&gt;</span> 图片展示 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">  <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> </span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
    <div class="portfolio-content">
        <ul class="cl portfolio-area">
        @foreach (var pic in Model)
        {
            <li class="item">
                <div class="portfoliobox">
                    <input class="checkbox" name="selectedIds" type="checkbox" value="@pic.Id">
                    <div class="picbox"><a href="@pic.Url" data-lightbox="gallery" data-title="客厅1"><img src="@pic.ThumbUrl"></a></div>
                </div>
            </li>
        }
        </ul>
    </div>
</div>

@section FooterScript
{
<script type="text/javascript" src="~/lib/lightbox2/2.8.1/js/lightbox-plus-jquery.min.js"></script>
<script type="text/javascript">
$(function(){
    $.Huihover(".portfolio-area li"); 
});
function datadel()
{
    var ids = new Array();
    $("input[name='selectedIds']:checked").each(function () {
        var value = $(this).val();
        ids.push(value);
    });
    alert(ids.join(","));
    $.ajax({
        url: "/House/DeletePics", type: "post", dataType: "json",
        data: { selectedIds: ids },
        success:function(res)
        {
            location.reload();
        },
        error: function () {
            alert("删除网络请求失败");
        }
    });
}
</script>
}